/**
 */
package org.xtext.tp4.minigobstones.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import org.xtext.tp4.minigobstones.Black;
import org.xtext.tp4.minigobstones.Blue;
import org.xtext.tp4.minigobstones.Commands;
import org.xtext.tp4.minigobstones.Condition;
import org.xtext.tp4.minigobstones.Definition;
import org.xtext.tp4.minigobstones.East;
import org.xtext.tp4.minigobstones.Green;
import org.xtext.tp4.minigobstones.HayBolitas;
import org.xtext.tp4.minigobstones.IfElse;
import org.xtext.tp4.minigobstones.InitStructure;
import org.xtext.tp4.minigobstones.MinigobstonesFactory;
import org.xtext.tp4.minigobstones.MinigobstonesPackage;
import org.xtext.tp4.minigobstones.Move;
import org.xtext.tp4.minigobstones.North;
import org.xtext.tp4.minigobstones.ProcedureDef;
import org.xtext.tp4.minigobstones.Put;
import org.xtext.tp4.minigobstones.Red;
import org.xtext.tp4.minigobstones.South;
import org.xtext.tp4.minigobstones.TypeColor;
import org.xtext.tp4.minigobstones.TypeMovement;
import org.xtext.tp4.minigobstones.West;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class MinigobstonesPackageImpl extends EPackageImpl implements MinigobstonesPackage
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass initStructureEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass definitionEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass procedureDefEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass conditionEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass hayBolitasEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass commandsEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass putEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass moveEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass ifElseEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass typeMovementEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass westEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass eastEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass northEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass southEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass typeColorEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass blackEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass redEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass blueEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass greenEClass = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see org.xtext.tp4.minigobstones.MinigobstonesPackage#eNS_URI
   * @see #init()
   * @generated
   */
  private MinigobstonesPackageImpl()
  {
    super(eNS_URI, MinigobstonesFactory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
   * 
   * <p>This method is used to initialize {@link MinigobstonesPackage#eINSTANCE} when that field is accessed.
   * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static MinigobstonesPackage init()
  {
    if (isInited) return (MinigobstonesPackage)EPackage.Registry.INSTANCE.getEPackage(MinigobstonesPackage.eNS_URI);

    // Obtain or create and register package
    MinigobstonesPackageImpl theMinigobstonesPackage = (MinigobstonesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MinigobstonesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MinigobstonesPackageImpl());

    isInited = true;

    // Create package meta-data objects
    theMinigobstonesPackage.createPackageContents();

    // Initialize created meta-data
    theMinigobstonesPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theMinigobstonesPackage.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(MinigobstonesPackage.eNS_URI, theMinigobstonesPackage);
    return theMinigobstonesPackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getInitStructure()
  {
    return initStructureEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getInitStructure_Definitions()
  {
    return (EReference)initStructureEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getDefinition()
  {
    return definitionEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getProcedureDef()
  {
    return procedureDefEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getProcedureDef_Name()
  {
    return (EAttribute)procedureDefEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getProcedureDef_Commands()
  {
    return (EReference)procedureDefEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getCondition()
  {
    return conditionEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getHayBolitas()
  {
    return hayBolitasEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getHayBolitas_Name()
  {
    return (EAttribute)hayBolitasEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getHayBolitas_Type()
  {
    return (EReference)hayBolitasEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getCommands()
  {
    return commandsEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getCommands_Name()
  {
    return (EAttribute)commandsEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getPut()
  {
    return putEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getPut_Type()
  {
    return (EReference)putEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getMove()
  {
    return moveEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getMove_Type()
  {
    return (EReference)moveEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getIfElse()
  {
    return ifElseEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getIfElse_Type()
  {
    return (EReference)ifElseEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getIfElse_Commands()
  {
    return (EReference)ifElseEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getTypeMovement()
  {
    return typeMovementEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getTypeMovement_Name()
  {
    return (EAttribute)typeMovementEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getWest()
  {
    return westEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getEast()
  {
    return eastEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getNorth()
  {
    return northEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSouth()
  {
    return southEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getTypeColor()
  {
    return typeColorEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getTypeColor_Name()
  {
    return (EAttribute)typeColorEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getBlack()
  {
    return blackEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getRed()
  {
    return redEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getBlue()
  {
    return blueEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getGreen()
  {
    return greenEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public MinigobstonesFactory getMinigobstonesFactory()
  {
    return (MinigobstonesFactory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    initStructureEClass = createEClass(INIT_STRUCTURE);
    createEReference(initStructureEClass, INIT_STRUCTURE__DEFINITIONS);

    definitionEClass = createEClass(DEFINITION);

    procedureDefEClass = createEClass(PROCEDURE_DEF);
    createEAttribute(procedureDefEClass, PROCEDURE_DEF__NAME);
    createEReference(procedureDefEClass, PROCEDURE_DEF__COMMANDS);

    conditionEClass = createEClass(CONDITION);

    hayBolitasEClass = createEClass(HAY_BOLITAS);
    createEAttribute(hayBolitasEClass, HAY_BOLITAS__NAME);
    createEReference(hayBolitasEClass, HAY_BOLITAS__TYPE);

    commandsEClass = createEClass(COMMANDS);
    createEAttribute(commandsEClass, COMMANDS__NAME);

    putEClass = createEClass(PUT);
    createEReference(putEClass, PUT__TYPE);

    moveEClass = createEClass(MOVE);
    createEReference(moveEClass, MOVE__TYPE);

    ifElseEClass = createEClass(IF_ELSE);
    createEReference(ifElseEClass, IF_ELSE__TYPE);
    createEReference(ifElseEClass, IF_ELSE__COMMANDS);

    typeMovementEClass = createEClass(TYPE_MOVEMENT);
    createEAttribute(typeMovementEClass, TYPE_MOVEMENT__NAME);

    westEClass = createEClass(WEST);

    eastEClass = createEClass(EAST);

    northEClass = createEClass(NORTH);

    southEClass = createEClass(SOUTH);

    typeColorEClass = createEClass(TYPE_COLOR);
    createEAttribute(typeColorEClass, TYPE_COLOR__NAME);

    blackEClass = createEClass(BLACK);

    redEClass = createEClass(RED);

    blueEClass = createEClass(BLUE);

    greenEClass = createEClass(GREEN);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    procedureDefEClass.getESuperTypes().add(this.getDefinition());
    hayBolitasEClass.getESuperTypes().add(this.getCondition());
    putEClass.getESuperTypes().add(this.getCommands());
    moveEClass.getESuperTypes().add(this.getCommands());
    ifElseEClass.getESuperTypes().add(this.getCommands());
    westEClass.getESuperTypes().add(this.getTypeMovement());
    eastEClass.getESuperTypes().add(this.getTypeMovement());
    northEClass.getESuperTypes().add(this.getTypeMovement());
    southEClass.getESuperTypes().add(this.getTypeMovement());
    blackEClass.getESuperTypes().add(this.getTypeColor());
    redEClass.getESuperTypes().add(this.getTypeColor());
    blueEClass.getESuperTypes().add(this.getTypeColor());
    greenEClass.getESuperTypes().add(this.getTypeColor());

    // Initialize classes and features; add operations and parameters
    initEClass(initStructureEClass, InitStructure.class, "InitStructure", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getInitStructure_Definitions(), this.getDefinition(), null, "definitions", null, 0, -1, InitStructure.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(definitionEClass, Definition.class, "Definition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(procedureDefEClass, ProcedureDef.class, "ProcedureDef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getProcedureDef_Name(), ecorePackage.getEString(), "name", null, 0, 1, ProcedureDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getProcedureDef_Commands(), this.getCommands(), null, "commands", null, 0, -1, ProcedureDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(conditionEClass, Condition.class, "Condition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(hayBolitasEClass, HayBolitas.class, "HayBolitas", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getHayBolitas_Name(), ecorePackage.getEString(), "name", null, 0, 1, HayBolitas.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getHayBolitas_Type(), this.getTypeColor(), null, "type", null, 0, 1, HayBolitas.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(commandsEClass, Commands.class, "Commands", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getCommands_Name(), ecorePackage.getEString(), "name", null, 0, 1, Commands.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(putEClass, Put.class, "Put", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getPut_Type(), this.getTypeColor(), null, "type", null, 0, 1, Put.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(moveEClass, Move.class, "Move", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getMove_Type(), this.getTypeMovement(), null, "type", null, 0, 1, Move.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(ifElseEClass, IfElse.class, "IfElse", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getIfElse_Type(), this.getCondition(), null, "type", null, 0, 1, IfElse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getIfElse_Commands(), this.getCommands(), null, "commands", null, 0, -1, IfElse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(typeMovementEClass, TypeMovement.class, "TypeMovement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getTypeMovement_Name(), ecorePackage.getEString(), "name", null, 0, 1, TypeMovement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(westEClass, West.class, "West", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(eastEClass, East.class, "East", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(northEClass, North.class, "North", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(southEClass, South.class, "South", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(typeColorEClass, TypeColor.class, "TypeColor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getTypeColor_Name(), ecorePackage.getEString(), "name", null, 0, 1, TypeColor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(blackEClass, Black.class, "Black", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(redEClass, Red.class, "Red", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(blueEClass, Blue.class, "Blue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(greenEClass, Green.class, "Green", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    // Create resource
    createResource(eNS_URI);
  }

} //MinigobstonesPackageImpl
